﻿// Picturez
//
// Copyright © Frank Nagl, 2008-2012
// admin@franknagl.de
// www.franknagl.de
//
namespace Picturez
{
    using System;

    partial class MainForm
    {
        private void BiggestLengthKryptonRadioButtonCheckedChanged(
            object sender, EventArgs e)
        {
            BiggestLengthKryptonTextBox.Enabled = 
                !BiggestLengthKryptonTextBox.Enabled;
            if (BiggestLengthKryptonRadioButton.Checked) 
                Current.ResizeVersion = ResizeVersion.BiggestLength;
        }

        private void BmpKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (BmpKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Bmp;
        }

        private void EmfKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (EmfKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Emf;
        }

        private void FixedSizeKryptonRadioButtonCheckedChanged(
            object sender, EventArgs e)
        {
            WidthKryptonTextBox.Enabled = !WidthKryptonTextBox.Enabled;
            HeightKryptonTextBox.Enabled = !HeightKryptonTextBox.Enabled;
            StretchKryptonCheckBox.Enabled = !StretchKryptonCheckBox.Enabled;
            if (FixedSizeKryptonRadioButton.Checked)
            {
                Current.ResizeVersion = ResizeVersion.FixedSize;
            }
        }

        private void GifKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (GifKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Gif;
        }

        private void JpgKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            QualityKryptonTextBox.Enabled = !QualityKryptonTextBox.Enabled;
            QualityTrackBar.Enabled = !QualityTrackBar.Enabled;
            if (JpgKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Jpg;
        }

        private void OriginalPathKryptonCheckBoxCheckedChanged(
            object sender, EventArgs e)
        {
            Current.UseOriginalPath = OriginalPathKryptonCheckBox.Checked;
            OutputPathKryptonLabel.Enabled = !OutputPathKryptonLabel.Enabled;
            ChangePathKryptonButton.Enabled = !ChangePathKryptonButton.Enabled;
        }

        private void OriginalSizeKryptonRadioButtonCheckedChanged(
            object sender, EventArgs e)
        {
            if (OriginalSizeKryptonRadioButton.Checked)
                Current.ResizeVersion = ResizeVersion.No;
        }

        private void OverwriteKryptonCheckBoxCheckedChanged(object sender, EventArgs e)
        {
            Current.FileOverwriting = OverwriteKryptonCheckBox.Checked;
        }

        private void PngKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (PngKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Png;
        }

        private void StretchKryptonCheckBoxCheckedChanged(object sender, EventArgs e)
        {
            Current.StretchImage = StretchKryptonCheckBox.Checked;
        }

        private void TifKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (TifKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Tif;
        }

        private void WmfKryptonRadioButtonCheckedChanged(object sender, EventArgs e)
        {
            if (WmfKryptonRadioButton.Checked)
                Current.Format = ImageFormats.Wmf;
        }
    }
}
